/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.msk.base.mapper.goods;


import com.msk.base.domain.goods.Goods;
import com.msk.sys.mapper.CrudDao;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <p>[]</p>
 * <p>作者：lh</p>
 * <p>邮箱：lh@xiangyou.com</p>
 * <p>创建时间： 2018-11-30 </p>
 * <p>类说明：货主信息审核DAO接口 </p>
 * <p>修改记录：</p>
 */
@Repository
public interface GoodsDao extends CrudDao<Goods> {
	public Long findCount(Goods goods);
	/**   
	 * @Title: findListByType   
	 * @Description: TODO(查询type=4--9)   
	 * @param: @return   
	 * @author: wuyao      
	 * @return: List<Goods>      
	 * @throws   
	 * @date:   2018-12-15 下午5:04:36  
	 * @Copyright: 2018 
	 */  
	public List<Goods> findListByType(Goods goods);

	/**
	 * 根据状态和时间更新询价状态
	 * @param goods
	 */
	public void updateGoodsTypeByDate(Goods goods);

	/**
	 * 根据状态和时间更新询价状态
	 * @param goods
	 */
	public void updateGoodsStatusByDate(Goods goods);

	/**
	 * 根据状态和时间更新询价状态
	 * @param goods
	 */
	public void updateGoodsStatusFlow(Goods goods);

	/**
	 *
	 * 查询符合自动询价的货源信息
	 * @param goods
	 * @return
	 */
	public List<Goods> findListByTypeAndTime(Goods goods);
	/**
	 * 获取当天货源的数量
	 * @param param
	 * @return
	 */
	public int findDateCount(Map<String, Object> param);

	/**
	 * 获取当天最大货源编号
	 * @param param
	 * @return
	 */
	public String findDateMaxCode(Map<String, Object> param);
	
	/**
	 *
	 * 系统统计页面查询
	 * @param goods
	 * @return
	 */
	public List<Goods> goodsStatisticsReport(Goods goods);

	/**
	 *总成交额
	 */
	public double getZcjje(@Param("createDate0")  String createDate0,@Param("createDate1")  String createDate1);

	/**
	 *根据publishWay计算交额
	 */
	public double getFbsl(@Param("createDate0")  String createDate0,@Param("createDate1")  String createDate1, @Param("publishWay") String publishWay );

	/**
	 *根据publishWay计算交额
	 */
	public Goods getDg(@Param("createDate0")  String createDate0,@Param("createDate1")  String createDate1, @Param("publishWay") String publishWay );

	/**
	 * 根据订单编号查询货源
	 * @param orderNo
	 * @return
	 */
	public Goods selectByOrderNo(String orderNo);

	/**
	 * 根据订单编号更改支付状态
	 * @param goods
	 * @return
	 */
	public int updateByOrderNo(Goods goods);

	/**
	 * 根据ID更改支付状态
	 * @param goods
	 * @return
	 */
	public int updatePayStatusById(Goods goods);

	/**
	 * 根据订单编号更改单价和总价
	 * @param goods
	 * @return
	 */
	public int updatePriceByOrderNo(Goods goods);

	public Goods selectGoodsById(Goods goods);

	/**
	 * @Description 货主货源列表
	 * @Author wlxiang
	 * @Date 13:49 2023/6/6
	 * @Param
	 * @param contact
	 * @param publishWay
	 * @param type
	 * @return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
	 **/
	public List< Map<String,Object>> selectGoodsListByContact(@Param("contact")String contact,@Param("publishWay")String publishWay,@Param("type")String type);
	
	/**
	 * @author llh
	 * @date 2023/6/16
	 * @return java.util.List<com.msk.base.domain.goods.Goods>
	 * @description 货主签约列表      
	 */
	public List<Map<String,Object>> findSignedList(Goods goods);

	/**
	 * @author llh
	 * @date 2023/8/7 14:10
	 * @param goods
	 * @description 查询货主未签约货源数量
	 * @return int
	 */
	public int findUnsignedCount(Goods goods);
	
	/**
	 * @author llh
	 * @date 2023/6/16
	 * @return com.msk.base.domain.goods.Goods
	 * @description 货主签约详情      
	 */
	public Goods getSignedInfo(Goods goods);
	
	/**
	 * @Description 货源询价列表
	 * @Author wlxiang
	 * @Date 17:12 2023/7/3
	 * @Param 
	 * @param supplierUser //司机、承运商ID
	 * @param biddingStatus //竞价状态 0:未竞价 1:竞价中 2:竞价成功 3:竞价失败
	 * @return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
	 **/
	public List<Map<String,Object>> selectSourceInquiryListByContact(@Param("supplierUser")String supplierUser,@Param("biddingStatus")String biddingStatus);
}